﻿using Client.MainModule.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.MainModule {
  public class MainModule : IModule {
    public void OnInitialized(IContainerProvider containerProvider) {
      //初始化的时候，添加一个组件到对应的区域
      var regionManager=containerProvider.Resolve<IRegionManager>();
      regionManager.RegisterViewWithRegion("LeftMenuTreeRegion", typeof(TreeMenuView));
      regionManager.RegisterViewWithRegion("MainHeaderRegion", typeof(MainHeaderView));
    }

    public void RegisterTypes(IContainerRegistry containerRegistry) {
      containerRegistry.Register<TreeMenuView>();
      containerRegistry.Register<MainHeaderView>();
    }
  }
}
